#!/usr/bin/python3
#quart_to_rpy.py
import sys
import math
w = float(sys.argv[4])
x = float(sys.argv[1])
y = float(sys.argv[2])
z = float(sys.argv[3])
alpha = math.atan2(2*(w*x+y*z),1-2*(x*x+y*y))
angle = math.atan2(2*(w*z+x*y),1-2*(z*z+y*y))
angle = angle*180/math.pi
alpha = alpha*180/math.pi

print(alpha)
print(angle)